package com.mlnx.netty.base.handler;


import com.mlnx.data.entity.TempInfo;
import com.mlnx.netty.base.message.TempMessage;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * 体温handler
 */
public class PushTempHandle extends SimpleChannelInboundHandler<TempMessage> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, TempMessage msg) throws Exception {
        String deviceId = msg.getDeviceId();

        TempInfo tempInfo = new TempInfo();
        tempInfo.setDeviceId(deviceId);
        tempInfo.setPatientId(msg.getPatientId());
        tempInfo.setTemp(msg.getPacketTime());

        tempInfo.setTemp(msg.getTemp());
    }
}
